﻿@model ContactManagement.Models.EditUserAdminModel
@{
    ViewBag.Title = GlobalResources.PageTitles.CreateUserRESX;
}

<div class="span12">
    <h2>@GlobalResources.PageTitles.CreateUserRESX</h2>
    <hr />
</div>
<div class="span12">
    @using (Html.BeginForm(EActionUser.UserAdd.ToString(), EControllers.User.ToString(), FormMethod.Post, new { @class = "form-horizontal" }))
    {
        <fieldset>
            @Html.MyValidationSummary()
            @Html.ShowCustomMessage()

            <div class="control-group">
                @Html.LabelFor(model => model.UserTitle, new { @class = "control-label" })

                <div class="controls">
                    @Html.DropDownListFor(model => model.UserTitle, Model.UserTitles, GlobalResources.GlobalStrings.PleaseSelectItemsRESX)
                    @Html.ValidationMessageFor(model => model.UserTitle)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.Firstname, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Firstname)
                    @Html.ValidationMessageFor(model => model.Firstname)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.Lastname, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Lastname)
                    @Html.ValidationMessageFor(model => model.Lastname)
                </div>
            </div>

            <div class="control-group">
                @Html.LabelFor(model => model.UserName, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.UserName)
                    @Html.ValidationMessageFor(model => model.UserName)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.Category, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Category)
                    @Html.ValidationMessageFor(model => model.Category)
                </div>
            </div>
            @* Um was für eine Art von Benutzer es sich handelt, kann nur von einem Admin oder SuperUser festgelegt werden! *@
            @if (CurrentSession.GetCurrentUser().IsAdminOrSuperUser())
            {
                <div class="control-group">
                    @Html.LabelFor(model => model.UserType, new { @class = "control-label" })

                    <div class="controls">
                        @Html.EditorFor(model => model.UserType)
                        @Html.ValidationMessageFor(model => model.UserType)
                    </div>
                </div>
            }
            <div class="control-group">
                @Html.LabelFor(model => model.IsActiveUser, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.IsActiveUser)
                    @Html.ValidationMessageFor(model => model.IsActiveUser)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.Logintries, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Logintries)
                    @Html.ValidationMessageFor(model => model.Logintries)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.Street, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Street)
                    @Html.ValidationMessageFor(model => model.Street)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.ZipCode, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.ZipCode)
                    @Html.ValidationMessageFor(model => model.ZipCode)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.City, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.City)
                    @Html.ValidationMessageFor(model => model.City)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.HouseNumber, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.HouseNumber)
                    @Html.ValidationMessageFor(model => model.HouseNumber)
                </div>
            </div>


            <div class="control-group">
                @Html.LabelFor(model => model.Handy, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Handy)
                    @Html.ValidationMessageFor(model => model.Handy)
                </div>
            </div>
            <div class="control-group">
                @Html.LabelFor(model => model.Birthdate, new { @class = "control-label" })

                <div class="controls">
                    @Html.EditorFor(model => model.Birthdate)
                    @Html.ValidationMessageFor(model => model.Birthdate)
                </div>
            </div>
            <div class="form-actions">
                <input class="btn btn-primary" type="submit" value="@GlobalResources.Navigation.CreateUserRESX" />
            </div>
        </fieldset>
    }
</div>

<div class="span12">
    <div class="well">
        @Html.ActionLink(GlobalResources.Navigation.BackToListRESX, EActionUser.UserList.ToString(), EControllers.User.ToString(), null, new { @class = "btn btn-small", data_icon = "icon-arrow-left" })
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
